<template>
	<view>
		<view class="menu">
			<template v-if="active===1">
				<view class="item">
					<image src="@/static/house/hz.png" mode=""></image>
					<text>整租</text>
				</view>
				<view class="item">
					<image src="@/static/house/zz.png" mode=""></image>
					<text>合租</text>
				</view>
				<view class="item">
					<image src="@/static/house/bk.png" mode=""></image>
					<text>避坑指南</text>
				</view>
				<view class="item">
					<image src="@/static/house/zn.png" mode=""></image>
					<text>合作委托</text>
				</view>
			</template>
			<template v-if="active===2">
				<view class="item">
					<image src="@/static/house/hz.png" mode=""></image>
					<text>整租1</text>
				</view>
				<view class="item">
					<image src="@/static/house/zz.png" mode=""></image>
					<text>合租1</text>
				</view>
				<view class="item">
					<image src="@/static/house/bk.png" mode=""></image>
					<text>避坑指南1</text>
				</view>
				<view class="item">
					<image src="@/static/house/zn.png" mode=""></image>
					<text>合作委托1</text>
				</view>
			</template>
		</view>
		<view class="zhishiqi">
			<view class="item" :class="active===1?'active':''" @click="changeActive(1)"></view>
			<view class="item" :class="active===2?'active':''" @click="changeActive(2)"></view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				active: 2
			}
		},
		methods: {
			changeActive(val) {
				this.active = val
			}
		}
	}
</script>

<style lang="scss">
	.menu {
		display: flex;
		align-items: center;
		margin-top: 20rpx;
		background-color: #FFFFFF;
		padding: 10rpx;
		border-radius: 20rpx;

		.item {
			flex: 1;
			display: flex;
			flex-direction: column;
			align-items: center;

			image {
				width: 100rpx;
				height: 100rpx;
			}
		}
	}

	.zhishiqi {
		display: flex;
		justify-content: center;
		margin: 10rpx 0;

		.item {
			width: 60rpx;
			height: 10rpx;
			border-radius: 5rpx;
			background-color: #D9F3EA;
		}

		.active {
			background-color: #60C696;
		}
	}
</style>
